/** Description of SmokersTabs.java 
 * @version 1.0
 * 
 * @author panther
 * Jayant Pratim Saikia
 * jay.saikia@gmail.com
 *
 */
package com.panther.awp.android.smoker.start;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

import com.panther.awp.android.smoker.R;
import com.panther.awp.android.smoker.activities.Brands;
import com.panther.awp.android.smoker.activities.Smoke;
import com.panther.awp.android.smoker.activities.Stats;

public class SmokersTabs extends TabActivity {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
	    Resources res = getResources(); // Resource object to get Drawables
	    TabHost tabHost = getTabHost();  // The activity TabHost
	    TabHost.TabSpec spec;  // Resusable TabSpec for each tab
	    Intent intent;  // Reusable Intent for each tab

	    // Create an Intent to launch an Activity for the tab (to be reused)
	    intent = new Intent().setClass(this, Smoke.class);

	    // Initialize a TabSpec for each tab and add it to the TabHost
	    spec = tabHost.newTabSpec("one").setIndicator("Smoke",
	                      res.getDrawable(R.drawable.ic_tab_smoke))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    // Do the same for the other tabs
	    intent = new Intent().setClass(this, Brands.class);
	    spec = tabHost.newTabSpec("two").setIndicator("Brands",
	                      res.getDrawable(R.drawable.ic_tab_brand))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    intent = new Intent().setClass(this, Stats.class);
	    spec = tabHost.newTabSpec("three").setIndicator("Statistics",
	                      res.getDrawable(R.drawable.ic_tab_stats))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    tabHost.setCurrentTab(0);
	}
}
